<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>    
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="js/jquery/jquery.js"></script>
<script type="text/javascript" src="js/log2traffic.js"></script>
<script type="text/javascript" src="js/log2trafficFactory.js"></script>
<title>Log2Traffic</title>
<style>
</style>
</head>
<body style="background: #F0F0F0">
    <jsp:include page="header.jsp"></jsp:include>
	  <div style="width: 2670px; margin: 10px 10px; padding: 10px 10px; background: #FFFFFF; font-family: arial,sans-serif; border-radius: 15px;">
			<table cellpadding="0" cellspacing="0">
				<tr>
					<td style="padding: 5px 10px; text-align: right;">Period for table: </td>
					<td style="padding: 5px 10px;" >
						<input name="period_radio" type="radio" value="Months" onclick="presenter.update();"><span id="monthsRadioText" style="white-space: nowrap;">Last months</span></input>
						<input name="period_radio" type="radio" value="Weeks" onclick="presenter.update();"><span id="weeksRadioText" style="white-space: nowrap;">Last weeks</span></input>
						<input name="period_radio" type="radio" value="Days" onclick="presenter.update();"><span id="daysRadioText" style="white-space: nowrap;">Last days</span></input>
						<input name="period_radio" type="radio" value="Hours" onclick="presenter.update();"><span id="hoursRadioText" style="white-space: nowrap;">Last hours</span></input>
					</td>
				</tr>
				<tr>
				  <td style="padding: 5px 10px; text-align: right;">Sorted by: </td>
					<td style="padding: 5px 10px;" >
						<input name="sortedBy_radio" type="radio" value="count" onclick="presenter.update();">amount of requests</input>
						<input name="sortedBy_radio" type="radio" value="maxRespTime" onclick="presenter.update();">max. response time</input>
						<input name="sortedBy_radio" type="radio" value="spentTime" onclick="presenter.update();">sum all response times</input>
						<input name="sortedBy_radio" type="radio" value="category" onclick="presenter.update();">service name</input>
					</td>					
			   </tr>
			</table>
			<div id="viewHtml" style="display: none;">
            <div style="padding: 10px; text-align: center; margin-bottom: 10px;">
              <span style="font-size: 15pt; width: 1px; white-space: nowrap;"><span style="font-weight: bold;" id="configName"></span>&nbsp;from <span style="font-weight: bold;" id="from"></span>&nbsp;to&nbsp;<span style="font-weight: bold;" id="to"></span></span>
            </div>
            <div style="clear: both;">&nbsp;</div>        
          <div id="mainTableContainer" style="float: left; font-size: 12px; max-width: 1380px; height: 1024px; overflow: auto;">
            <table id="mainTable"></table>
          </div>
          <div id="imageContainer" style="float: left;"></div>
          <div style="clear: both;">&nbsp;</div>
      </div>
    Results generated by <B><a traget="log2traffic" href="http://log2traffic.googlecode.com/">log2traffic ver. 0.4</a></B> written by Stanislaw Jagiella</div>
    </div>
    <jsp:include page="footer.jsp"></jsp:include>
		
	<script>
		 var dto = {
		         config_name: '${requestScope.configuration}'
		 }
		 var presenter = log2TrafficFactory[dto.config_name].getPresenter();
		 $(document).ready(function() {
			 presenter.loadJSON();
			 presenter.init();
			 presenter.update();
		 });
	</script>
	
</body>
</html>